Some transport protocols implement forward error correction (FEC) to recover dropped or corrupted data packets without requiring retransmission. FEC adds metadata redundancy to a data packet by encoding the data packet prior to transmission. The added redundancy is used to detect and recover missing or corrupt portions of the received data. Some example error correction codes include Hamming, Bose-Chaudhuri-Hochquenghem (BCH), Reed-Solomon (RS), Viterbi, trellis, etc.
More recently, turbo coding schemes have been developed that utilize a combination of two or more FEC encoding schemes to provide greater bit-error rate correction capability and increase throughput. For example, RS encoding is often combined with another encoding. Turbo codes improve data correction by using combined probability data to reconcile differences between data values predicted for the two FEC schemes. For example, a decoder for each scheme may be used to generate prospective corrected values (with derived likelihoods) for a set of data bits. The corrected values of the two schemes are compared, and if they differ, the decoders exchange the probability information calculated for each bit of the data. Each decoder incorporates the information from the other decoder to generate new corrected values, which are again compared. This iterative decoding process is repeated, over a number of cycles, until the two decoders produce the same corrected data values. Due to its high performance, turbo-coding schemes are expected to remain in widespread use for FEC encoding and decoding.
To increase throughput for streaming applications, most FEC decoders perform the iterative decoding process using a number of decoder stages arranged in a pipeline. Each stage in the pipeline implements one iteration of the decoding process. However, the entire decoding pipeline typically has a large latency that poses a challenge to the implementation of some FEC features. For example, in FEC decoding, error statistics are important for evaluation of and adjustment of transmission channel characteristics to improve bandwidth and reduce errors. In some previous approaches, located errors are counted in each stage as the data block is processed. However, this approach is not accurate because a bit may be toggled several times in the iterative decoding process. For example, bits may be corrected at one stage, and reverted at the next stage.
Some other approaches provide accurate error statistics by storing uncorrected data until the final decode stage has completed. The corrected data is XOR'ed with the buffered uncorrected data to generate an error mask indicating the location where the error occurred in the data block. For example, an error mask may use a ‘1’ to indicate an error occurred in that bit location and a ‘0’ to indicate no error. The error mask is used to generate statistics for the whole decode chain such as a number of bits corrected, number of corrected 0 bits, number of corrected 1 bits, etc.